package com.tlw.leave.service.impl;

import com.tlw.leave.dao.InformationRecordDao;
import com.tlw.leave.entity.InformationRecord;
import com.tlw.leave.service.InformationRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;

@Service
public class InformationRecordServiceImpl implements InformationRecordService {

    @Autowired
    private InformationRecordDao informationRecordDao;

    @Transactional
    @Override
    public InformationRecord addInformation(InformationRecord informationRecord) {
        return informationRecordDao.save(informationRecord);
    }

    @Override
    public InformationRecord updateInformationRecord(InformationRecord informationRecord) {
        return informationRecordDao.saveAndFlush(informationRecord);
    }
}
